<div id="contents">
	<div id="main">
		<div id="mainContents" class="content_info">
			<div id="bukken_sch_box">
				<a id="add_new" href="<?php echo url_for('@user_edit') ?>" title="Đăng Ký">Đăng Ký</a><br /><br />
				<div id="search">
					<form name="frmSearch" id="frmSearch" action="<?php echo url_for('@user') ?>" method="post" onsubmit="return searchCondition()">
						<img src="<?php echo image_path('logo_small.gif') ?>" title="HYBRIDロゴ" alt="HYBRIDロゴ" width="181" height="21" />
						&nbsp;&nbsp;
						<input type="text" id="keyword" name="keyword" size="70" style="ime-mode:active;" value="<?php echo $strKeyword ?>" />
						&nbsp;
						<input type="submit" value="Search" style="width: 80px;" />
						<span id="staff_search_loader" style="display: none;">
							<img src="<?php echo image_path('trunk_loader.gif')?>" />
							Searching ...
						</span>
					</form>
				</div>
			</div>
			<br />
			<div id="list" style="margin: 0 auto; width: 98%;"></div>
		</div><!--id mainContents end-->
	</div><!-- id main end-->
	<hr />
</div><!-- id contents end-->

<script type="text/javascript">
	searchAjax('<?php echo $sf_data->getRaw('strParam') ?>');

	function searchAjax(strPars)
	{
		if (strPars.length = 0) {
			strPars = '?page=1';
		}
		document.getElementById('list').innerHTML = '';

		updateLink('add_new', strPars);
		new Ajax.Updater('list', '<?php echo url_for('@user_search') ?>',
			{method:'get', parameters: strPars, onComplete:function(request, json){Element.hide("staff_search_loader")}, onLoading:function(request, json){Element.show("staff_search_loader")}
			, requestHeaders: ['If-Modified-Since', '01 Jan 1970 00:00:00 GMT']});
		window.scroll(0, 0);
	}

	function searchCondition()
	{
		trimElementValue('keyword');

		var strPars = '?page=1';
		var strSearchKey = $('keyword').value;
		if (strSearchKey.length > 0) {
			strPars += '&keyword=' + strSearchKey;
		}
		<?php if (isset($strType)): ?>
			strPars += '&type=<?php echo $strType ?>';
		<?php endif; ?>
		<?php if (isset($strUserIds)): ?>
			strPars += '&strUserIds=<?php echo $strUserIds ?>';
		<?php endif; ?>
		searchAjax(strPars);
		return false;
	}
</script>